//
//  UIImage+extension.swift
//  FWSinaWeibo
//
//  Created by 范伟 on 16/2/22.
//  Copyright © 2016年 FanWei. All rights reserved.
//

import UIKit

extension UIImage {
    
    class func fw_singleDotImage(color: UIColor) -> UIImage {
        UIGraphicsBeginImageContextWithOptions(CGSize(width: 1, height: 1), false, UIScreen.mainScreen().scale)
        //画图，填充一个颜色
        color.setFill()
        UIRectFill(CGRect(x: 0, y: 0, width: 1, height: 1))
        //从图形上下文中获取图像
        let image = UIGraphicsGetImageFromCurrentImageContext()
        //关闭上下文对象释放内存
        UIGraphicsEndImageContext()
        return image
    }
}
